.class public Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;
.super Ljava/lang/Object;
.source "AudioPlayer.java"

# interfaces
.implements Landroid/media/AudioManager$OnAudioFocusChangeListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$f;,
        Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;,
        Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;
    }
.end annotation


# static fields
.field private static k:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;


# instance fields
.field private a:Landroid/media/MediaPlayer;

.field private b:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;

.field private c:Ljava/lang/String;

.field private d:Z

.field private e:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$f;

.field private f:Landroid/media/AudioManager;

.field private g:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

.field private h:Landroid/media/MediaPlayer$OnPreparedListener;

.field private i:Landroid/media/MediaPlayer$OnErrorListener;

.field private j:Landroid/media/MediaPlayer$OnCompletionListener;


# direct methods
.method public constructor <init>()V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x1

    .line 2
    iput-boolean v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->d:Z

    .line 3
    sget-object v0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;->NONE:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->g:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    .line 4
    new-instance v0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$a;

    invoke-direct {v0, p0}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$a;-><init>(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;)V

    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->h:Landroid/media/MediaPlayer$OnPreparedListener;

    .line 5
    new-instance v0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$b;

    invoke-direct {v0, p0}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$b;-><init>(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;)V

    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->i:Landroid/media/MediaPlayer$OnErrorListener;

    .line 6
    new-instance v0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$c;

    invoke-direct {v0, p0}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$c;-><init>(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;)V

    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->j:Landroid/media/MediaPlayer$OnCompletionListener;

    .line 7
    invoke-static {}, Les/c5;->a()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "audio"

    .line 8
    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/media/AudioManager;

    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->f:Landroid/media/AudioManager;

    return-void
.end method

.method static synthetic a(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;)Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;
    .locals 0

    .line 2
    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->g:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    return-object p1
.end method

.method static synthetic a(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;Ljava/lang/String;)Ljava/lang/String;
    .locals 0

    .line 4
    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->c:Ljava/lang/String;

    return-object p1
.end method

.method static synthetic a(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;Ljava/lang/String;I)V
    .locals 0

    .line 3
    invoke-direct {p0, p1, p2}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a(Ljava/lang/String;I)V

    return-void
.end method

.method private a(Ljava/lang/String;I)V
    .locals 2

    .line 22
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "error msg:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v1, ", code:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "AudioPlayer"

    invoke-static {v1, v0}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 23
    sget-object v0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;->ERROR:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->g:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    .line 24
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->b:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;

    if-eqz v0, :cond_0

    .line 25
    invoke-interface {v0, p1, p2}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;->a(Ljava/lang/String;I)V

    .line 26
    :cond_0
    iget-object p2, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->e:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$f;

    if-eqz p2, :cond_1

    const/4 v0, 0x0

    .line 27
    invoke-interface {p2, v0, p1}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$f;->a(ZLjava/lang/String;)V

    :cond_1
    return-void
.end method

.method static synthetic a(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;)Z
    .locals 0

    .line 1
    iget-boolean p0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->d:Z

    return p0
.end method

.method static synthetic b(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;Ljava/lang/String;)I
    .locals 0

    .line 2
    invoke-direct {p0, p1}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->b(Ljava/lang/String;)I

    move-result p0

    return p0
.end method

.method private b(Ljava/lang/String;)I
    .locals 7
    .annotation build Landroidx/annotation/WorkerThread;
    .end annotation

    .line 3
    invoke-static {p1}, Lcom/esfile/screen/recorder/media/util/u;->a(Ljava/lang/String;)[Landroid/media/MediaFormat;

    move-result-object p1

    const/4 v0, 0x0

    .line 4
    aget-object p1, p1, v0

    if-nez p1, :cond_0

    const/4 p1, 0x1

    return p1

    :cond_0
    const-string v1, "channel-count"

    .line 5
    invoke-static {p1, v1, v0}, Lcom/esfile/screen/recorder/media/util/s;->a(Landroid/media/MediaFormat;Ljava/lang/String;I)I

    move-result v1

    if-lez v1, :cond_3

    const/4 v2, 0x2

    if-le v1, v2, :cond_1

    goto :goto_0

    :cond_1
    const-wide/16 v3, 0x0

    const-string v1, "durationUs"

    .line 6
    invoke-static {p1, v1, v3, v4}, Lcom/esfile/screen/recorder/media/util/s;->a(Landroid/media/MediaFormat;Ljava/lang/String;J)J

    move-result-wide v5

    cmp-long p1, v5, v3

    if-gtz p1, :cond_2

    return v2

    :cond_2
    return v0

    :cond_3
    :goto_0
    const/4 p1, 0x3

    return p1
.end method

.method static synthetic b(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;)Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->g:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    return-object p0
.end method

.method static synthetic c(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;)Landroid/media/MediaPlayer;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    return-object p0
.end method

.method static synthetic c(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;Ljava/lang/String;)V
    .locals 0

    .line 2
    invoke-direct {p0, p1}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->d(Ljava/lang/String;)V

    return-void
.end method

.method private c(Ljava/lang/String;)V
    .locals 1

    .line 3
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    if-nez v0, :cond_0

    .line 4
    invoke-direct {p0}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->e()V

    .line 5
    :cond_0
    sget-object v0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;->PREPARED:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->g:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    .line 6
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->b:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;

    if-eqz v0, :cond_1

    .line 7
    invoke-interface {v0}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;->onPrepare()V

    .line 8
    :cond_1
    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->c:Ljava/lang/String;

    .line 9
    new-instance v0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$d;

    invoke-direct {v0, p0, p1}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$d;-><init>(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;Ljava/lang/String;)V

    invoke-static {v0}, Les/xc;->a(Ljava/lang/Runnable;)V

    return-void
.end method

.method private c()Z
    .locals 4

    .line 10
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/4 v1, 0x0

    const/4 v2, 0x1

    const/16 v3, 0x1a

    if-lt v0, v3, :cond_1

    .line 11
    new-instance v0, Landroid/media/AudioAttributes$Builder;

    invoke-direct {v0}, Landroid/media/AudioAttributes$Builder;-><init>()V

    const/4 v3, 0x2

    .line 12
    invoke-virtual {v0, v3}, Landroid/media/AudioAttributes$Builder;->setContentType(I)Landroid/media/AudioAttributes$Builder;

    move-result-object v0

    .line 13
    invoke-virtual {v0}, Landroid/media/AudioAttributes$Builder;->build()Landroid/media/AudioAttributes;

    move-result-object v0

    .line 14
    new-instance v3, Landroid/media/AudioFocusRequest$Builder;

    invoke-direct {v3, v2}, Landroid/media/AudioFocusRequest$Builder;-><init>(I)V

    .line 15
    invoke-virtual {v3, v0}, Landroid/media/AudioFocusRequest$Builder;->setAudioAttributes(Landroid/media/AudioAttributes;)Landroid/media/AudioFocusRequest$Builder;

    move-result-object v0

    .line 16
    invoke-virtual {v0, v2}, Landroid/media/AudioFocusRequest$Builder;->setAcceptsDelayedFocusGain(Z)Landroid/media/AudioFocusRequest$Builder;

    move-result-object v0

    .line 17
    invoke-virtual {v0, p0}, Landroid/media/AudioFocusRequest$Builder;->setOnAudioFocusChangeListener(Landroid/media/AudioManager$OnAudioFocusChangeListener;)Landroid/media/AudioFocusRequest$Builder;

    move-result-object v0

    .line 18
    invoke-virtual {v0}, Landroid/media/AudioFocusRequest$Builder;->build()Landroid/media/AudioFocusRequest;

    move-result-object v0

    .line 19
    iget-object v3, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->f:Landroid/media/AudioManager;

    invoke-virtual {v3, v0}, Landroid/media/AudioManager;->abandonAudioFocusRequest(Landroid/media/AudioFocusRequest;)I

    move-result v0

    if-ne v0, v2, :cond_0

    const/4 v1, 0x1

    :cond_0
    return v1

    .line 20
    :cond_1
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->f:Landroid/media/AudioManager;

    invoke-virtual {v0, p0}, Landroid/media/AudioManager;->abandonAudioFocus(Landroid/media/AudioManager$OnAudioFocusChangeListener;)I

    move-result v0

    if-ne v0, v2, :cond_2

    const/4 v1, 0x1

    :cond_2
    return v1
.end method

.method static synthetic d(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;)Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->b:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;

    return-object p0
.end method

.method public static d()Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;
    .locals 2

    .line 2
    const-class v0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;

    monitor-enter v0

    .line 3
    :try_start_0
    sget-object v1, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->k:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;

    if-nez v1, :cond_0

    .line 4
    new-instance v1, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;

    invoke-direct {v1}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;-><init>()V

    sput-object v1, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->k:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;

    .line 5
    :cond_0
    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 6
    sget-object v0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->k:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;

    return-object v0

    :catchall_0
    move-exception v1

    .line 7
    :try_start_1
    monitor-exit v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1
.end method

.method private d(Ljava/lang/String;)V
    .locals 7
    .annotation build Landroidx/annotation/UiThread;
    .end annotation

    .line 8
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    if-nez v0, :cond_0

    const/4 p1, 0x2

    const-string v0, "ERROR_PLAYER_IS_NULL"

    .line 9
    invoke-direct {p0, v0, p1}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a(Ljava/lang/String;I)V

    return-void

    :cond_0
    if-eqz v0, :cond_8

    .line 10
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->g:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    sget-object v2, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;->PREPARED:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    if-ne v1, v2, :cond_8

    .line 11
    invoke-virtual {v0}, Landroid/media/MediaPlayer;->reset()V

    .line 12
    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    .line 13
    invoke-virtual {v0}, Landroid/net/Uri;->getScheme()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    const/4 v2, 0x6

    const-string v3, "ERROR_SETDATASOURCE_ILLEGALSTATE"

    const/4 v4, 0x0

    const-string v5, "ERROR_IOEXCEPTION"

    if-eqz v1, :cond_4

    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_4

    .line 14
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 15
    :try_start_0
    new-instance v1, Ljava/io/FileInputStream;

    invoke-direct {v1, v0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    .line 16
    invoke-virtual {v1}, Ljava/io/FileInputStream;->getFD()Ljava/io/FileDescriptor;

    move-result-object v0

    .line 17
    iget-object v6, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v6, v0}, Landroid/media/MediaPlayer;->setDataSource(Ljava/io/FileDescriptor;)V

    .line 18
    invoke-virtual {v1}, Ljava/io/FileInputStream;->close()V

    .line 19
    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->c:Ljava/lang/String;
    :try_end_0
    .catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_3
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    :catch_0
    move-exception p1

    goto :goto_0

    :catch_1
    move-exception p1

    .line 20
    :goto_0
    sget-boolean v0, Les/u6;->a:Z

    if-eqz v0, :cond_1

    .line 21
    invoke-virtual {p1}, Ljava/lang/RuntimeException;->printStackTrace()V

    .line 22
    :cond_1
    invoke-direct {p0, v3, v2}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a(Ljava/lang/String;I)V

    return-void

    :catch_2
    move-exception p1

    .line 23
    sget-boolean v0, Les/u6;->a:Z

    if-eqz v0, :cond_2

    .line 24
    invoke-virtual {p1}, Ljava/io/IOException;->printStackTrace()V

    .line 25
    :cond_2
    invoke-direct {p0, v5, v4}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a(Ljava/lang/String;I)V

    return-void

    :catch_3
    move-exception p1

    .line 26
    sget-boolean v0, Les/u6;->a:Z

    if-eqz v0, :cond_3

    .line 27
    invoke-virtual {p1}, Ljava/io/FileNotFoundException;->printStackTrace()V

    :cond_3
    const/4 p1, 0x1

    const-string v0, "ERROR_FILENOTFOUND"

    .line 28
    invoke-direct {p0, v0, p1}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a(Ljava/lang/String;I)V

    return-void

    .line 29
    :cond_4
    :try_start_1
    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    invoke-static {}, Les/c5;->a()Landroid/content/Context;

    move-result-object v6

    invoke-virtual {v1, v6, v0}, Landroid/media/MediaPlayer;->setDataSource(Landroid/content/Context;Landroid/net/Uri;)V

    .line 30
    iput-object p1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->c:Ljava/lang/String;
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_7
    .catch Ljava/lang/IllegalArgumentException; {:try_start_1 .. :try_end_1} :catch_6
    .catch Ljava/lang/IllegalStateException; {:try_start_1 .. :try_end_1} :catch_5

    .line 31
    :goto_1
    :try_start_2
    iget-object p1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    invoke-virtual {p1}, Landroid/media/MediaPlayer;->prepareAsync()V

    .line 32
    invoke-direct {p0}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->f()Z
    :try_end_2
    .catch Ljava/lang/IllegalStateException; {:try_start_2 .. :try_end_2} :catch_4

    goto :goto_3

    :catch_4
    move-exception p1

    .line 33
    sget-boolean v0, Les/u6;->a:Z

    if-eqz v0, :cond_5

    .line 34
    invoke-virtual {p1}, Ljava/lang/IllegalStateException;->printStackTrace()V

    :cond_5
    const/4 p1, 0x4

    const-string v0, "ERROR_PREPARE_ILLEGALSTATE"

    .line 35
    invoke-direct {p0, v0, p1}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a(Ljava/lang/String;I)V

    goto :goto_3

    :catch_5
    move-exception p1

    goto :goto_2

    :catch_6
    move-exception p1

    .line 36
    :goto_2
    sget-boolean v0, Les/u6;->a:Z

    if-eqz v0, :cond_6

    .line 37
    invoke-virtual {p1}, Ljava/lang/RuntimeException;->printStackTrace()V

    .line 38
    :cond_6
    invoke-direct {p0, v3, v2}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a(Ljava/lang/String;I)V

    return-void

    :catch_7
    move-exception p1

    .line 39
    sget-boolean v0, Les/u6;->a:Z

    if-eqz v0, :cond_7

    .line 40
    invoke-virtual {p1}, Ljava/io/IOException;->printStackTrace()V

    .line 41
    :cond_7
    invoke-direct {p0, v5, v4}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a(Ljava/lang/String;I)V

    :cond_8
    :goto_3
    return-void
.end method

.method static synthetic e(Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;)Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$f;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->e:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$f;

    return-object p0
.end method

.method private e()V
    .locals 2

    .line 2
    new-instance v0, Landroid/media/MediaPlayer;

    invoke-direct {v0}, Landroid/media/MediaPlayer;-><init>()V

    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    const/4 v1, 0x3

    .line 3
    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setAudioStreamType(I)V

    .line 4
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setLooping(Z)V

    .line 5
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->h:Landroid/media/MediaPlayer$OnPreparedListener;

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setOnPreparedListener(Landroid/media/MediaPlayer$OnPreparedListener;)V

    .line 6
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->i:Landroid/media/MediaPlayer$OnErrorListener;

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setOnErrorListener(Landroid/media/MediaPlayer$OnErrorListener;)V

    .line 7
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    iget-object v1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->j:Landroid/media/MediaPlayer$OnCompletionListener;

    invoke-virtual {v0, v1}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V

    return-void
.end method

.method private f()Z
    .locals 4

    .line 1
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/4 v1, 0x0

    const/4 v2, 0x1

    const/16 v3, 0x1a

    if-lt v0, v3, :cond_1

    .line 2
    new-instance v0, Landroid/media/AudioAttributes$Builder;

    invoke-direct {v0}, Landroid/media/AudioAttributes$Builder;-><init>()V

    const/4 v3, 0x2

    .line 3
    invoke-virtual {v0, v3}, Landroid/media/AudioAttributes$Builder;->setContentType(I)Landroid/media/AudioAttributes$Builder;

    move-result-object v0

    .line 4
    invoke-virtual {v0}, Landroid/media/AudioAttributes$Builder;->build()Landroid/media/AudioAttributes;

    move-result-object v0

    .line 5
    new-instance v3, Landroid/media/AudioFocusRequest$Builder;

    invoke-direct {v3, v2}, Landroid/media/AudioFocusRequest$Builder;-><init>(I)V

    .line 6
    invoke-virtual {v3, v0}, Landroid/media/AudioFocusRequest$Builder;->setAudioAttributes(Landroid/media/AudioAttributes;)Landroid/media/AudioFocusRequest$Builder;

    move-result-object v0

    .line 7
    invoke-virtual {v0, v2}, Landroid/media/AudioFocusRequest$Builder;->setAcceptsDelayedFocusGain(Z)Landroid/media/AudioFocusRequest$Builder;

    move-result-object v0

    .line 8
    invoke-virtual {v0, p0}, Landroid/media/AudioFocusRequest$Builder;->setOnAudioFocusChangeListener(Landroid/media/AudioManager$OnAudioFocusChangeListener;)Landroid/media/AudioFocusRequest$Builder;

    move-result-object v0

    .line 9
    invoke-virtual {v0}, Landroid/media/AudioFocusRequest$Builder;->build()Landroid/media/AudioFocusRequest;

    move-result-object v0

    .line 10
    iget-object v3, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->f:Landroid/media/AudioManager;

    invoke-virtual {v3, v0}, Landroid/media/AudioManager;->requestAudioFocus(Landroid/media/AudioFocusRequest;)I

    move-result v0

    if-ne v0, v2, :cond_0

    const/4 v1, 0x1

    :cond_0
    return v1

    .line 11
    :cond_1
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->f:Landroid/media/AudioManager;

    const/4 v3, 0x3

    invoke-virtual {v0, p0, v3, v2}, Landroid/media/AudioManager;->requestAudioFocus(Landroid/media/AudioManager$OnAudioFocusChangeListener;II)I

    move-result v0

    if-ne v0, v2, :cond_2

    const/4 v1, 0x1

    :cond_2
    return v1
.end method


# virtual methods
.method public a()V
    .locals 2

    .line 15
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    .line 16
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->b()V

    .line 17
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->release()V

    .line 18
    iput-object v1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    .line 19
    iput-object v1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->c:Ljava/lang/String;

    .line 20
    :cond_0
    iput-object v1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->e:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$f;

    .line 21
    iput-object v1, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->b:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;

    return-void
.end method

.method public a(Ljava/lang/String;Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;)V
    .locals 1

    const/4 v0, 0x1

    .line 11
    iput-boolean v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->d:Z

    .line 12
    iput-object p2, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->b:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;

    const/4 p2, 0x0

    .line 13
    iput-object p2, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->e:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$f;

    .line 14
    invoke-direct {p0, p1}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->c(Ljava/lang/String;)V

    return-void
.end method

.method public a(Ljava/lang/String;Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$f;)V
    .locals 1

    const/4 v0, 0x0

    .line 7
    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->b:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;

    const/4 v0, 0x0

    .line 8
    iput-boolean v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->d:Z

    .line 9
    iput-object p2, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->e:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$f;

    .line 10
    invoke-direct {p0, p1}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->c(Ljava/lang/String;)V

    return-void
.end method

.method public a(Ljava/lang/String;)Z
    .locals 2

    .line 5
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->g:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    sget-object v1, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;->PREPARED:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    if-eq v0, v1, :cond_0

    sget-object v1, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;->PLAYING:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    if-ne v0, v1, :cond_1

    :cond_0
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->c:Ljava/lang/String;

    .line 6
    invoke-static {p1, v0}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result p1

    if-eqz p1, :cond_1

    const/4 p1, 0x1

    goto :goto_0

    :cond_1
    const/4 p1, 0x0

    :goto_0
    return p1
.end method

.method public b()V
    .locals 2

    .line 7
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    if-eqz v0, :cond_3

    .line 8
    invoke-virtual {v0}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 9
    :try_start_0
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->stop()V
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 10
    sget-boolean v1, Les/u6;->a:Z

    if-eqz v1, :cond_0

    .line 11
    invoke-virtual {v0}, Ljava/lang/IllegalStateException;->printStackTrace()V

    :cond_0
    const/4 v0, 0x7

    const-string v1, "ERROR_STOP_ILLEGALSTATE"

    .line 12
    invoke-direct {p0, v1, v0}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->a(Ljava/lang/String;I)V

    return-void

    :cond_1
    :goto_0
    const/4 v0, 0x0

    .line 13
    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->c:Ljava/lang/String;

    .line 14
    sget-object v0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;->STOP:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    iput-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->g:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$State;

    .line 15
    iget-object v0, p0, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->b:Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;

    if-eqz v0, :cond_2

    .line 16
    invoke-interface {v0}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer$e;->onStop()V

    .line 17
    :cond_2
    invoke-direct {p0}, Lcom/esfile/screen/recorder/picture/picker/widget/AudioPlayer;->c()Z

    :cond_3
    return-void
.end method

.method public onAudioFocusChange(I)V
    .locals 0

    return-void
.end method
